cmake_minimum_required (VERSION 3.10)
project("sge" VERSION 0.0.1 LANGUAGES CXX C)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

find_package(assimp CONFIG REQUIRED)
find_package(glfw3 CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)

#add_subdirectory("deps/flecs")

if (WIN32)
	set(BIN_LIB assimp::assimp glm::glm glfw)
else()
	set(BIN_LIB assimp::assimp glm glfw flecs)
endif()

set(SRC_EXE "src/main.cpp")
set(SRC_IMGUI
	"src/imgui/imgui.cpp"		       "src/imgui/imgui_widgets.cpp"
	"src/imgui/imgui_draw.cpp"	       "src/imgui/imgui_impl_glfw.cpp"
	"src/imgui/imgui_impl_opengl3.cpp" "src/imgui/imgui_tables.cpp")
set(SRC_LIB
	"src/mesh.cpp"
	"src/window.cpp"		"src/model.cpp"
	"src/shader.cpp"		"src/engine.cpp"
	"src/texture.cpp"		"src/gui.cpp"
    "src/camera.cpp"		"src/objects.cpp")
set(INC_LIB
	"include/Camera.hpp"	 "include/Engine.hpp"
	"include/Mesh.hpp"       "include/GUI.hpp"
	"include/Window.hpp"	 "include/Model.hpp"
	"include/Shader.hpp"     "include/gl/BO.hpp"
	"include/gl/Stencil.hpp" "include/Texture.hpp")

include_directories("include" "include/imgui")

add_library(flecs STATIC "src/flecs.c" "include/flecs.h")
#target_compile_options(asa PRIVATE "-lWs2_32")
add_library(imgui STATIC ${SRC_IMGUI})
target_link_libraries(imgui PRIVATE ${BIN_LIB})
add_library(glad STATIC "src/glad.c" "include/glad/glad.h")

add_executable(sge ${SRC_EXE} ${SRC_LIB} ${INC_LIB})
#target_compile_options(sge PRIVATE "-lWs2_32")
target_link_libraries(sge PRIVATE ${BIN_LIB} imgui flecs glad)
